// import com.alibaba.druid.sql.ast.SQLDeclareItem;
// import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStatementImpl;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "MySqlDeclareStatement.h"
#include "../../../../ast/SQLDeclareItem.h"
#include "../../visitor/MySqlASTVisitor.h"
#include "../../../../../utils/listTran.h"

MySqlDeclareStatement::MySqlDeclareStatement()
{
  varList = std::make_shared<std::list<SQLDeclareItem_ptr>>();
}

SQLDeclareItem_list_ptr MySqlDeclareStatement::getVarList()
{
  return varList;
}

void MySqlDeclareStatement::addVar(SQLDeclareItem_ptr expr)
{
  varList->push_back(expr);
}

void MySqlDeclareStatement::setVarList(SQLDeclareItem_list_ptr varList)
{
  this->varList = varList;
}

// @Override
void MySqlDeclareStatement::accept0(MySqlASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(MySqlDeclareStatement)))
  {
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLDeclareItem, SQLObject>(varList);
    acceptChild(visitor, tmp1);
  }
  visitor->endVisit(SharedObject(MySqlDeclareStatement));
}

// @Override
SQLDeclareItem_list_ptr MySqlDeclareStatement::getChildren()
{
  return varList;
}
